cd\

cd C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

echo off

REM **
echo ************
echo NOTE: This batch file must be run from a Visual Studio 2005 Command Prompt
echo ************

REM ** This batch file
REM ** 1) Sets the directories and file access privilege depending on the OS.
REM **    This is necessary so that the WSE trace files can be successfully written
REM ** 2) Generates and installs sample certificates into the certificate stores
REM ** 	  for use with the Quickstart samples. 
REM ** 

echo See the WSSP Quickstart Readme.txt in this directory for more details.
echo ******* Important ******* 

REM ** Set up the Certificates
set SERVER_NAME=IMercadoService
set CLIENT_NAME=SampleClient
set STS_NAME=IMercadoSTSAuthority
set ROOT_NAME=BVMFPSERootCA

echo %ROOT_NAME%

certmgr -del -r LocalMachine -s Root -c -n %ROOT_NAME%

REM Server Certs
certmgr -del -r LocalMachine -s My -c -n %SERVER_NAME%

REM Client Cert
certmgr -del -r LocalMachine -s My -c -n %CLIENT_NAME%

REM Router Cert
certmgr -del -r LocalMachine -s My -c -n %STS_NAME%

echo ************
echo Making Root cert
echo ************
makecert -pe -n CN=%ROOT_NAME% -ss Root -sr LocalMachine -a sha1 -sky signature -r "QuickstartsAuthority.cer"

echo ************
echo Server cert setup starting
echo %SERVER_NAME%
echo ************
echo Making server cert
echo ************
makecert.exe -sr LocalMachine -ss TrustedPeople -a sha1 -n CN=%SERVER_NAME% -sky exchange -pe -is Root -ir LocalMachine -in %ROOT_NAME%

echo ************
echo Router cert setup starting
echo %ROUTER_NAME%
echo ************
echo Making router cert
echo ************
makecert.exe -sr LocalMachine -ss TrustedPeople -a sha1 -n CN=%STS_NAME% -sky exchange -pe -is Root -ir LocalMachine -in %ROOT_NAME%
echo ************


REM echo ************
REM echo Client cert setup starting
REM echo %CLIENT_NAME%
REM echo ************
REM echo Making client cert
REM echo ************
REM makecert.exe -sr LocalMachine -ss TrustedPeople -a sha1 -n CN=%CLIENT_NAME% -sky exchange -pe -is Root -ir LocalMachine -in %ROOT_NAME%
REM echo ************

pause